<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 
<jsp:useBean id="bean" class="com.lmpop.frame.util.RandomID" scope="page"/>
<%@page import="com.lmpop.trade.ti_voucher.*" %>

<%
	String pri_key = bean.GenTradeId();
	String user_id="";
 	if(session.getAttribute("session_user_id")!=null){
	     user_id  =session.getAttribute("session_user_id").toString();
	}
	Map rulesMap=new Hashtable();
	Ti_PaymentRulesInfo ti_paymentruleInfo =new Ti_PaymentRulesInfo();
	String rules_select=ti_paymentruleInfo.getSelectString("");
%>

<html>
  <head>
    <title>优惠券管理</title>
	<link href="/program/admin/index/css/style.css" rel="stylesheet" type="text/css">
	<script type="text/javascript" src="index.js"></script>
	<script type="text/javascript" src="/js/commen.js"></script>
	<script language="javascript" type="text/javascript" src="/program/plugins/calendar/WdatePicker.js"></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/engine.js'></script>
	<script type='text/javascript' src='<%=request.getContextPath()%>/dwr/util.js'></script>
</head>

<body>
	<h1>新增优惠券管理</h1>
	<form action="/doTradeReg.do" method="post" name="addForm">
	
	<input name="voucher_id" id="voucher_id" type="hidden" value="<%=pri_key%>"/>

	<table width="100%" cellpadding="0" cellspacing="1" border="0" class="listtab">
		
		<tr>
			<td align="right" width="30%">
				优惠券类型<font color="red">*</font>
			</td>
			<td>
			<select name="voucher_type" id="voucher_type" >
								  	<%=rules_select%>
						</select>
			</td>
		</tr>
		
		<tr>
			<td align="right" width="30%">
				优惠券名称<font color="red">*</font>
			</td>
			<td><input name="voucher_name" id="voucher_name" size="20" maxlength="20" type="text" /></td>
		</tr>
		
		<tr>
			<td align="right" width="30%">
				使用规则<font color="red">*</font>
			</td>
			<td>
			<select name="usage_rules" id="usage_rules" >
									<option value="1">满额使用</option>
									<option value="2">满量使用</option>
									<option value="3">无条件</option>
						</select>
			</td>
		</tr>
		
		<tr>
			<td align="right" width="30%">
				开始时间<font color="red">*</font>
			</td>
			<td><input  name="start_time" id="start_time" size="20" maxlength="20" type="text" onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'end_time\')}',minDate:'%y-%M-%d',readOnly:true})" /></td>
		</tr>
		
		<tr>
			<td align="right" width="30%">
				结束时间<font color="red">*</font>
			</td>
			<td><input  name="end_time" id="end_time" size="20" maxlength="20" type="text" onfocus="WdatePicker({minDate:'#F{$dp.$D(\'start_time\',{d:+1})}',readOnly:true})" /></td>
		</tr>
		
		<tr>
			<td align="right" width="30%">
				数量<font color="red">*</font>
			</td>
			<td><input name="number" id="number" size="5" maxlength="5" type="text" onKeyUp="if(isNaN(value))this.value=''"/></td>
		</tr>
		
		<tr>
			<td align="right" width="30%">
				金额<font color="red">*</font>
			</td>
			<td><input name="money" id="money" size="5" maxlength="5" type="text" onKeyUp="if(isNaN(value))this.value=''"/></td>
		</tr>
		
		<tr>
			<td align="right" width="30%">
				财产类型<font color="red">*</font>
			</td>
			<td>
			<select name="property_type" id="property_type" >
									<option value="1">人民币</option>
									<option value="2">积分</option>
						</select>
			</td>
		</tr>
		
		
	</table>
	
	<table width="100%" cellpadding="0" cellspacing="0" border="0">
		<tr>
			<td align="center">
			    <input type="hidden" id="state_code" name="state_code" value="0"/> 
				<input type="hidden" name="bpm_id" value="9015" />
				<input name="user_id" id="user_id" type="hidden" value="<%=user_id %>" />
				<input type="button" class="buttoncss" name="tradeSub" value="提交" onclick="return checkSub('addForm');"/>&nbsp;&nbsp;
				<input type="button" class="buttoncss" name="tradeRut" value="返回" onclick="window.location.href='index.jsp';"/>
			</td>
		</tr>
	</table>
	</form>
</body>

</html>

